<?php

return [
    'aliases' => [
        '@bower' => '@vendor/bower-asset',
        '@npm' => '@vendor/npm-asset',
    ],
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'bootstrap' => ['log'],
    'language' => 'zh-CN',
    'timeZone' => 'Asia/Shanghai',
    'components' => [
        'request' => [
            'class' => 'common\web\Request',
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'commonCache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'errorHandler' => [
            'class' => 'common\base\ErrorHandler',
        ],
        'user' => [
            'class' => 'common\components\User',
            'enableAutoLogin' => true,
            'enableSession' => false,
            'loginUrl' => null
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 10 : 3,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                    'logFile' => '@app/runtime/logs/' . date('Ym/d') . '.log',
                    'logVars' => ['_GET', '_POST'],
                ],
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['info'],
                    'logFile' => '@app/runtime/debug/' . date('Ym/d') . '.log',
                    'logVars' => ['_GET', '_POST'],
                ]
            ],
        ],
        'i18n' => [
            'translations' => [
                '*' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@common/messages',
                ],
            ],
        ],
        'formatter' => [
            'class' => 'common\i18n\Formatter',
            'locale' => 'zh-CN',
            'dateFormat' => 'yyyy-MM-dd',
            'datetimeFormat' => 'yyyy-MM-dd HH:mm:ss',
            'decimalSeparator' => '.',
            'thousandSeparator' => ',',
            'currencyCode' => 'CNY',
            'imageNullDisplay' => '@web/themes/images/undefind.jpg',
        ],
        //系统加密
        'security' => [
            'class' => 'common\base\Security',
            'cipher' => 'AES-256-CBC',
        ],
        //微信小程序
        'wechatMp' => [
            'class' => 'common\components\wechat\MpWechat',
        ],
    ]
];
